<template>
  <div class="component-vm">
    <el-form :inline="true" :model="formInline" class="demo-form-inline">
      <el-form-item :label="title">
        <el-input v-model="formInline.vm" placeholder="请输入" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
// import { getSearchVendingList } from '@/api/vmStatus'
export default {
  props: {
    tableData: {
      type: Array,
      default: () => []
    },
    title: {
      type: String,
      required: true
    }
  },
  data() {
    return {
      formInline: {
        vm: ''
      },
      pageIndex: 1,
      pageSize: 10

    }
  },
  methods: {
    async onSubmit() {
      // const res = await getSearchVendingList(this.pageIndex, this.pageSize, this.formInline.vm)
      // console.log(res)
      // // this.tableData = res.data.currentPageRecords
      // // 刷新页面
      // this.$emit('update:tableData', res.data.currentPageRecords)
      this.$emit('refreshList', this.formInline.vm)
      this.formInline.vm = ''
      // this.$store.commit('vm/setSearchList', res.data.currentPageRecords)
    }
  }
}
</script>
<style scoped lang="scss">
.component-vm{
  height: 64px;
  background-color: #fff;
  padding-top: 10px;
  padding-left: 20px;
}
</style>
